Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class com.pacist.diamonds.PolygonButton

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--com.pacist.diamonds.DiamondCanvas
                    |
                    +--com.pacist.diamonds.DrawnButton
                          |
                          +--com.pacist.diamonds.PolygonButton

public class PolygonButton
extends DrawnButton
A component implementing a button which can be drawn to form any polygon shape.

See Also:
Serialized Form

Field Summary
java.awt.Polygon polygon
          Internal data structure for the PolygonButton.
 
Fields inherited from class com.pacist.diamonds.DrawnButton
armed, behaviour, BUTTON, buttonListeners, flags, LABEL, mouseIn, NOTIFY_ARM, NOTIFY_DISARM, RADIO, SHADOW_ALL, SHADOW_BORDER, SHADOW_BOTTOM, SHADOW_LEFT, SHADOW_NONE, SHADOW_RIGHT, SHADOW_ROUNDED, SHADOW_TOP, shadowType, state, states, TOGGLE, tracking, TRISTATE, what
 
Fields inherited from class com.pacist.diamonds.DiamondCanvas
tipText
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
PolygonButton()
          Creates and initializes a PolygonButton object.
PolygonButton(java.awt.Polygon polygon)
          Creates and initializes a PolygonButton with BUTTON behaviour, and using the specified polygonal shape.
PolygonButton(java.awt.Polygon polygon, int behaviour)
          Creates and initializes a PolygonButton with the specified behaviour, and using the specified polygonal shape.
PolygonButton(java.awt.Polygon polygon, int behaviour, java.lang.Object what)
          Deprecated. Creates and initializes a PolygonButton with the specified behaviour, and using the specified polygonal shape.
 
Method Summary
java.awt.Polygon getPolygon()
          Returns the shape of the button.
java.awt.Dimension getPreferredSize()
          Returns the preferred size of the PolygonButton.
java.lang.String getTipText()
          Returns the Tip text for the button.
boolean inButton(int x, int y)
          Determines whether a co-ordinate lies inside the button.
void paintButton(java.awt.Graphics g, boolean down)
          This method is called to redraw this button.
java.awt.Dimension preferredSize()
          Deprecated. Returns the preferred size of the PolygonButton.
void setPolygon(java.awt.Polygon polygon)
          Sets the shape of the button.
 
Methods inherited from class com.pacist.diamonds.DrawnButton
addActionListener, getBehaviour, getButtonListeners, getNotify, getShadowType, getState, inButton, isArmed, isDown, isSet, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, paintButton, paint, processAction, removeActionListener, setArmed, setBehaviour, set, setEnabled, setNotify, setShadowType, setState, setStates
 
Methods inherited from class com.pacist.diamonds.DiamondCanvas
getTipText, mouseEnter, mouseExit, processMouseEvent, setTipText
 
Methods inherited from class java.awt.Canvas
addNotify, paint
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

polygon

protected java.awt.Polygon polygon
Internal data structure for the PolygonButton.
Constructor Detail

PolygonButton

public PolygonButton()
Creates and initializes a PolygonButton object.

PolygonButton

public PolygonButton(java.awt.Polygon polygon)
Creates and initializes a PolygonButton with BUTTON behaviour, and using the specified polygonal shape.
Parameters:
polygon - the shape of the button.
See Also:
DrawnButton

PolygonButton

public PolygonButton(java.awt.Polygon polygon,
                     int behaviour)
Creates and initializes a PolygonButton with the specified behaviour, and using the specified polygonal shape.
Parameters:
polygon - the shape of the button.
behaviour - the behaviour of the button.
See Also:
DrawnButton

PolygonButton

public PolygonButton(java.awt.Polygon polygon,
                     int behaviour,
                     java.lang.Object what)
Deprecated. As of JDK1.1.
Creates and initializes a PolygonButton with the specified behaviour, and using the specified polygonal shape.
Parameters:
polygon - the shape of the button.
behaviour - the behavior of the button.
what - additional object reference.
See Also:
DrawnButton
Method Detail

setPolygon

public void setPolygon(java.awt.Polygon polygon)
Sets the shape of the button.
Parameters:
polygon - the shape of the button.

getPolygon

public java.awt.Polygon getPolygon()
Returns the shape of the button.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the preferred size of the PolygonButton.
Returns:
Dimension - the size of the button.
Overrides:
getPreferredSize in class java.awt.Component

preferredSize

public java.awt.Dimension preferredSize()
Deprecated. as of JDK1.1.
Returns the preferred size of the PolygonButton.
Overrides:
preferredSize in class java.awt.Component
See Also:
getPreferredSize

paintButton

public void paintButton(java.awt.Graphics g,
                        boolean down)
This method is called to redraw this button.
Parameters:
g - the graphics context.
down - true if button is currently held down; false otherwise.
Overrides:
paintButton in class DrawnButton

inButton

public boolean inButton(int x,
                        int y)
Determines whether a co-ordinate lies inside the button.
Parameters:
x - the x co-ordinate.
y - the y co-ordinate.
Returns:
boolean - true if the given co-ordinates lie within the button; false otherwise.
Overrides:
inButton in class DrawnButton

getTipText

public java.lang.String getTipText()
Returns the Tip text for the button.
Overrides:
getTipText in class DiamondCanvas

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD